
using UnityEngine;
using System.Collections;

public class GameBG : MonoBehaviour
{
   
    int id = 1;
    



    void Start()
    {
        this.gameObject.AddComponent("MeshRenderer");
        this.gameObject.AddComponent("MeshFilter");
        this.gameObject.AddComponent("BoxCollider");
        
        this.gameObject.GetComponent<BoxCollider>().size = new Vector3(0, 0, 0);
        
        transform.localPosition = new Vector3(-1f, 1f, 0.2f);


        Mesh mesh = Quad.Create(8f, 6f);

        this.gameObject.GetComponent<MeshFilter>().mesh = mesh;
        this.gameObject.GetComponent<MeshRenderer>().material = AtlasManager.globalMaterial;

        this.gameObject.GetComponent<MeshFilter>().mesh.uv = new Vector2[]
		{
			new Vector2(AtlasManager.rects[id].xMin, AtlasManager.rects[id].yMax),
			new Vector2(AtlasManager.rects[id].xMax, AtlasManager.rects[id].yMax),
			new Vector2(AtlasManager.rects[id].xMax, AtlasManager.rects[id].yMin),
			new Vector2(AtlasManager.rects[id].xMin, AtlasManager.rects[id].yMin)
		};
    }



    void Update()
    {

    }

   
}



